package com.base.mapper.voipmapper;

import com.base.po.collect.CollectCommodities;
import com.base.po.collect.CollectCommoditiesExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface CollectCommoditiesMapper {
    int countByExample(CollectCommoditiesExample example);

    int deleteByExample(CollectCommoditiesExample example);

    int deleteByPrimaryKey(String ccId);

    int insert(CollectCommodities record);

    int insertSelective(CollectCommodities record);

    List<CollectCommodities> selectByExample(CollectCommoditiesExample example);

    CollectCommodities selectByPrimaryKey(String ccId);

    int updateByExampleSelective(@Param("record") CollectCommodities record, @Param("example") CollectCommoditiesExample example);

    int updateByExample(@Param("record") CollectCommodities record, @Param("example") CollectCommoditiesExample example);

    int updateByPrimaryKeySelective(CollectCommodities record);

    int updateByPrimaryKey(CollectCommodities record);

    /**
     * 获取用户收藏列表
     * @param uId  用户ID
     * @param pId 代理商ID
     * @param start  起始页
     * @param num   查询条数
     * @return
     */
    List<CollectCommodities> findCollectCommodityByUidAndPid(@Param("uId") String uId, @Param("pId") String pId, @Param("start") Integer start, @Param("num") Integer num);


    /**
     * 删除收藏记录
     * @param ccId
     * @return
     */
    boolean deleteByCcid(String ccId);

    /**
     * 更新收藏商品日期
     * @param collectCommodities
     * @return
     */
    boolean updateCollectCommodityDate(CollectCommodities collectCommodities);

    /**
     * 查询用户是否收藏了本商品
     * @param uId
     * @param comId
     * @param parentId
     * @return
     */
    List<CollectCommodities> hasCommodityBy(@Param("uId") String uId,@Param("comId") String comId,@Param("parentId") String parentId);

    /**
     * 取消收藏
     * @param collectCommodities
     * @return
     */
    boolean cancelCollect(CollectCommodities collectCommodities);

    boolean insertCollectCommodity(CollectCommodities collectCommodities);


}